package com.cnt.service.impl;

import com.cnt.dao.UserLogDao;
import com.cnt.service.UserLogService;
import com.cnt.vo.UserResultVo.LogResultVo;
import com.cnt.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserLogServiceImpl implements UserLogService {
    @Autowired
    private UserLogDao userLogDao;
    @Override
    public ResultVo<List<LogResultVo>> queryLogs(Integer userId, String account, Integer queryType, String startTime, String endTime) {
        System.out.println(userId+" "+account+" "+queryType+" "+" "+startTime+"  "+endTime);
        List<LogResultVo> logs = userLogDao.queryLogs(userId, account, queryType, startTime, endTime);
        if (logs.isEmpty()) {
            return new ResultVo(1, "暂无匹配日志信息", null);
        } else {
            return new ResultVo(0, "查询成功", logs);
        }
    }
}
